<template>
  <div class="tourist-container">
    <div class="top">
      <p class="title">实时访问统计</p>
      <p class="bg"></p>
      <p class="right">可容纳总量99245</p>
    </div>
    <div class="number">
      <span v-for="(item, key) in popleNumber">{{ item }}</span>
    </div>
    <div class="charts" ref="chartContainer"></div>
  </div>
</template>

<script setup lang="ts">
import * as echarts from 'echarts'
import 'echarts-liquidfill'
import { onMounted, ref } from 'vue'
let chartContainer = ref()
let popleNumber = ref('106570人')

onMounted(() => {
  let myChart = echarts.init(chartContainer.value)
  myChart.setOption({
    series: [
      {
        type: 'liquidFill',
        radius: '100%',
        outline: {
          show: true,
        },
        data: [
          0.5,
          0.4,
          {
            value: 0.3,
            itemStyle: {
              color: '#29fcff',
              opacity: 0.6,
            },
            emphasis: {
              itemStyle: {
                opacity: 0.9,
              },
            },
          },
        ],
      },
    ],
  })
})
</script>

<style lang="scss" scoped>
.tourist-container {
  width: 100%;
  height: 100%;
  background: url('../images/dataScreen-main-lt.png') no-repeat;
  background-size: 100% 100%;
  .top {
    margin-left: 20px;
    .title {
      color: #fff;
      font-size: 20px;
    }
    .bg {
      margin-top: 10px;
      width: 68px;
      height: 7px;
      background: url('../images/dataScreen-title.png') no-repeat;
      background-size: 100% 100%;
    }
    .right {
      margin-right: 8px;
      float: right;
      color: #fff;
      font-weight: 20px;
    }
  }
  .number {
    margin-top: 30px;
    padding: 0 5px;
    display: flex;
    gap: 2px;

    span {
      flex: 1;
      height: 40px;
      text-align: center;
      line-height: 40px;
      background: url('../images/total.png') no-repeat;
      background-size: 100% 100%;
      color: aqua;
    }
  }
  .charts {
    margin-top: 20px;
    width: 100%;
    height: 280px;
  }
}
</style>
